//
//  ReviewsCell.m
//  DFront
//
//  Created by lanou on 15/10/30.
//  Copyright © 2015年 xuzenghui. All rights reserved.
//

#import "ReviewsCell.h"
#import "UIImageView+WebCache.h"
#import "DFSignlTon.h"

@implementation ReviewsCell



-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        CGFloat lx = kScreenWidth/4;

        _imgsrcImage = [[UIImageView alloc]initWithFrame:CGRectMake(5, 9,lx ,lx * 3 / 4)];
        [self.contentView addSubview:_imgsrcImage];
        
        _stitleLabel = [[UILabel alloc]initWithFrame:CGRectMake(lx + 10, 0, lx * 3 - 16, 45)];
        _stitleLabel.font = [UIFont systemFontOfSize:15];
        _stitleLabel.numberOfLines = 0;
        [self.contentView addSubview:_stitleLabel];
        
        _sdateLabel = [[UILabel alloc]initWithFrame:CGRectMake(lx + 10, 55, 120, 15)];
        _sdateLabel.font = [UIFont systemFontOfSize:11];
        [self.contentView addSubview:_sdateLabel];
        
        UIImageView *aimage = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth - 58, 55, 15, 15)];
        aimage.image = [UIImage imageNamed:@"hot"];
        [self.contentView addSubview:aimage];
        _joinPeopleLabel = [[UILabel alloc]initWithFrame:CGRectMake(kScreenWidth - 40, 55,35 , 15)];
        _joinPeopleLabel.font = [UIFont systemFontOfSize:11];
        [self.contentView addSubview:_joinPeopleLabel];
        
//        UILabel *line = [[UILabel alloc] initWithFrame:CGRectMake(0, 90, kScreenWidth, 2)];
//        line.backgroundColor = [UIColor lightGrayColor];
//        [self.contentView addSubview:line];
        
    }
    return self;
}


-(void)setConfigureModel:(ReviewsModel *)ConfigureModel{
    
    _ConfigureModel = ConfigureModel;
    
    DFSignlTon *signlTon = [DFSignlTon shareInstance];
    if (signlTon.savemode == SaveModeYes)
    {
        _imgsrcImage.image = [UIImage imageNamed:@""];
    }else
    {
        [_imgsrcImage sd_setImageWithURL:[NSURL URLWithString:ConfigureModel.imgsrc]];
    }

    _stitleLabel.text = ConfigureModel.stitle;
    NSString *str = ConfigureModel.sdate;;
    _sdateLabel.text = [str substringToIndex:10];
  
    _joinPeopleLabel.text  = [NSString stringWithFormat:@"%@",ConfigureModel.joinPeople];
    
    
    
    
}



@end
